xen: fill topology info for all present cpus
authorJuergen Gross <jgross@suse.com>
Fri, 31 Aug 2018 15:22:05 +0000 (17:22 +0200)
committerWei Liu <wei.liu2@citrix.com>
Wed, 5 Sep 2018 10:21:26 +0000 (11:21 +0100)
commit780e2d309812e54353259bb9e6c28886e994b065
treeb891d039ed6f42fd2e9e335991e62b6902ac0551
parent2ec5339ec9218fbf1583fa85b74d1d2f15f1b3b8
xen: fill topology info for all present cpus

The topology information obtainable via XEN_SYSCTL_cputopoinfo is
filled rather weird: the size of the array is derived from the highest
online cpu number, so in case there are trailing offline cpus they
will not be included.

On a dual core system with 4 threads booted with smt=0 without this
patch xl info -n will print:

cpu_topology           :
cpu:    core    socket     node
  0:       0        0        0
  1:       0        0        0
  2:       1        0        0

while with this patch the output is:

cpu_topology           :
cpu:    core    socket     node
  0:       0        0        0
  1:       0        0        0
  2:       1        0        0
  3:       1        0        0

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/common/sysctl.c